<?php

namespace StudyBuddy;

class SubmittedUploadresourceWWW extends SubmittedUploadresource {

    protected $oForm;

    public function __construct(\StudyBuddy\Forms\Uploadresourceform $oForm) {
        $this->oForm = $oForm;
    }
    
    public function getCategory(){
        return $this->oForm->getSubmittedValue('category');
    }
    
    public function getLevel(){
        return $this->oForm->getSubmittedValue('level');
    }
    
    public function getSubject(){
        return $this->oForm->getSubmittedValue('subject');
    }
    
    public function getTitle(){
        return $this->oForm->getSubmittedValue('title');
    }
    
    public function getDescription(){
        return $this->oForm->getSubmittedValue('description');
    }
    
    public function getUploadedResource() {
        if (!$this->oForm->hasUploads()) {
            return null;
        }

        return $this->oForm->getUploadedResourceFile('resource_file');
    }

}
